package com.pktechan.api.service.impl;

import com.pktechan.api.base.BaseMapper;
import com.pktechan.api.base.BaseServiceImpl;
import com.pktechan.api.dao.ProductMapper;
import com.pktechan.api.entity.ProductBaseInfo;
import com.pktechan.api.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @program: cloudfloating
 * @description: 产品相关功能服务层实现
 * @author: qx.zhang
 * @create: 2021-03-05 11:48
 **/
@Service("productService")
@Transactional
public class ProductServiceImpl extends BaseServiceImpl<ProductBaseInfo> implements ProductService {

    @Autowired
    private ProductMapper productMapper;

    /**
     * 由业务类实现
     *
     * @return
     */
    @Override
    public BaseMapper<ProductBaseInfo> getBaseMapper() {
        return productMapper;
    }
    /**
     * 根据产品id集合获取
     * @param productIdList
     * @return
     */
    @Override
    public List<ProductBaseInfo> getProductByProductIds(List<Integer> productIdList) {
        return productMapper.getProductByProductIds(productIdList);
    }
    /**
     * 加盟产品列表
     *
     * @param productBaseInfo
     */
    @Override
    public List<ProductBaseInfo> getProductJoinList(ProductBaseInfo productBaseInfo) {
        return productMapper.getProductJoinList(productBaseInfo);
    }

}
